﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:BadHabit_Factory="clr-namespace:BadHabit.Factory"             
    xmlns:BadHabit_WPFTools="clr-namespace:BadHabit.WPFTools;assembly=BadHabit.WPFTools"                
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
    xmlns:props="clr-namespace:BadHabit.Factory.Windows.Properties"
    >


    <!-- BUTTONS *******************************************************************-->
    <Style TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Border Style="{StaticResource HighLightBorder}" Margin="0">
                        <ContentPresenter TextBlock.FontFamily="Impact"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
        
    <Style x:Key="ScrollDownButton" TargetType="RepeatButton">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Margin" Value="5,0,5,0"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="ClickMode" Value="Hover"/>
        <Setter Property="Foreground" Value="{StaticResource HighLightBorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource HighLightBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="control">
                    <Border Background="Transparent">
                        <Polygon
                            PresentationOptions:Freeze="True"
                            x:Name="arrow"
                                     Fill="{TemplateBinding Background}"
                                     Stroke="{TemplateBinding Foreground}"
                                     Points="0,0 20,0 10,10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter Property="Foreground" Value="Transparent"/>
                <Setter Property="Background" Value="Transparent"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="{StaticResource HighLightBorderBrush}"/>
                <Setter Property="Background" Value="{StaticResource HighLightBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="ScrollUpButton" TargetType="RepeatButton">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="ClickMode" Value="Hover"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="control">
                    <Border Background="Transparent">
                        <Polygon
                            PresentationOptions:Freeze="True"
                            x:Name="arrow" 
                                     Fill="{TemplateBinding Background}"
                                     Stroke="{TemplateBinding Foreground}"
                                     Points="10,0 20,10 0,10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter Property="Foreground" Value="Transparent"/>
                <Setter Property="Background" Value="Transparent"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="{StaticResource HighLightBorderBrush}"/>
                <Setter Property="Background" Value="{StaticResource HighLightBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    
  
    <Style TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="Hand" MinWidth="{TemplateBinding MinWidth}" Margin="3">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>                        
                        <Border x:Name="outOutBorder"
                                MinWidth="{TemplateBinding MinWidth}"
                                Grid.RowSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Center"   CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#156a15">
                            <Border x:Name="outBorder" CornerRadius="5,5,5,5"  BorderThickness="3" Background="#156a15">                                
                                <ContentPresenter                                                                             
                                        x:Name="content"
                                        Grid.RowSpan="2"
                                        OverridesDefaultStyle="True"
                                        TextBlock.Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,2,5,2"
                                        TextBlock.FontSize="13"                                        
                                        Content="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" >
                                </ContentPresenter>                                
                            </Border>
                        </Border>
                        <Border x:Name="reflexBorder" Background="White"  Opacity=".2" CornerRadius="0,0,5,5"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="outBorder" Property="Border.BorderBrush" Value="{StaticResource ExtraLightBrush}"/>
                            <Setter TargetName="reflexBorder" Property="Grid.Row" Value="1"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter TargetName="outBorder" Property="Border.BorderBrush" Value="#EFEFEF"/>
                            <Setter TargetName="reflexBorder" Property="Grid.Row" Value="0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="outBorder" Property="Border.Background" Value="LightGray"/>
                            <Setter TargetName="outOutBorder" Property="Border.BorderBrush" Value="LightGray"/>
                            <Setter TargetName="content" Property="TextBlock.Foreground" Value="Gray"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="OrangeButton" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="Hand">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.RowSpan="2" HorizontalAlignment="Stretch" MinWidth="{TemplateBinding Width}" VerticalAlignment="Center"   CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#ed960d">
                            <Border x:Name="outBorder" CornerRadius="5,5,5,5"  BorderThickness="3" Background="#ed960d">
                                <ContentPresenter                                                                             
                                        Grid.RowSpan="2"                                        
                                     TextBlock.FontSize="13"
                                        TextBlock.Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,2,5,2"                                        
                                        Content="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" >
                                </ContentPresenter>
                            </Border>
                        </Border>
                        <Border x:Name="reflexBorder" Background="White"  Opacity=".2" CornerRadius="0,0,5,5"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="outBorder" Property="Border.BorderBrush" Value="#ffcd69"/>
                            <Setter TargetName="reflexBorder" Property="Grid.Row" Value="1"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter TargetName="outBorder" Property="Border.BorderBrush" Value="#EFEFEF"/>
                            <Setter TargetName="reflexBorder" Property="Grid.Row" Value="0"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    

    <Style x:Key="TransparentButton" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">            
                    <ContentPresenter                                                                                                                         
                            Margin="{TemplateBinding Padding}" 
                            Content="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" >
                    </ContentPresenter>                                                                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Visibility" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="CommitButton" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    
                    <Border Name="border" CornerRadius="5" Background="#EEEEEE" Width="60">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>


                            <Image                    
                        x:Name="buttonImage"
                            Grid.Row="0"
                        Cursor="Hand"
                        Width="32" Height="32" Stretch="Uniform"                                        
                        Source="/Images/ToolBar/Commit.png"
                        ToolTip="{x:Static props:Resources.Commit_Changes}">
                                
                            </Image>
                            <TextBlock
                            Grid.Row="1"
                                TextAlignment="Center"
                            TextBlock.FontFamily="{StaticResource BasicFont}"
                                TextBlock.FontSize="{StaticResource BasicFontSize}"
                                TextBlock.Foreground="{StaticResource DarkTextBrush}"
                                Text="{x:Static props:Resources.Commit_Changes}"/>



                        </Grid>

                    </Border>
                    

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Border.Opacity" Value="0.5"/>
                        </Trigger>
                        <Trigger SourceName="buttonImage"  Property="IsMouseOver" Value="True">
                            <Setter TargetName="buttonImage" Property="Image.BitmapEffect">
                                <Setter.Value>
                                    <OuterGlowBitmapEffect GlowColor="{StaticResource NormalColor}" GlowSize="3" PresentationOptions:Freeze="True"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="UpButton" TargetType="Button">        
        <Setter Property="Foreground" Value="{StaticResource NormalBrush}"/>
        <Setter Property="Background" Value="{StaticResource DarkBrush}"/>
        <Setter Property="Height" Value="20"/>
        <Setter Property="Width" Value="20"/>
        <Setter Property="Cursor" Value="Hand"/>        
        <Setter Property="Command" Value="BadHabit_Factory:FactoryCommands.MoveUpClick" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate >              
                        <Polygon
                            PresentationOptions:Freeze="True"
                            x:Name="arrow" 
                            ToolTip="{x:Static props:Resources.Press_Ctrl_ADD}"
                             Fill="{TemplateBinding Background}"
                             Stroke="{TemplateBinding Foreground}"
                             Points="10,0 20,10 0,10" HorizontalAlignment="Center" VerticalAlignment="Center"/>              
                </ControlTemplate>
            </Setter.Value>
        </Setter>        
        <Style.Triggers>
            <Trigger Property="Button.IsEnabled" Value="False">
                <Setter Property="Button.Visibility" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="Button.IsMouseOver" Value="True">
                <Setter Property="Button.Background" Value="{StaticResource HighLightBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="DownButton" TargetType="Button">
        <Setter Property="Background" Value="{StaticResource DarkBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource NormalBrush}"/>
        <Setter Property="Height" Value="20"/>
        <Setter Property="Width" Value="20"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Command" Value="BadHabit_Factory:FactoryCommands.MoveDownClick" />
                
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate >
                    <Polygon
                            PresentationOptions:Freeze="True"
                            x:Name="arrow"
                            ToolTip="{x:Static props:Resources.Press_Ctrl_SUB}"
                           Fill="{TemplateBinding Background}"
                           Stroke="{TemplateBinding Foreground}"
                           Points="0,0 20,0 10,10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>            
            <Trigger Property="Button.IsMouseOver" Value="True">
                <Setter Property="Button.Background" Value="{StaticResource HighLightBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>


</ResourceDictionary>